
class DdzVO {
    public gameName: string = "DdzVo";
    public static VO: DdzVO = null;
    public static getVo(): DdzVO {
        if (!DdzVO.VO) {
            DdzVO.VO = new DdzVO();
        }
        return DdzVO.VO;
    }
    public dwServerRule: number;          //房间规则
    public wChairCount: number;           //椅子数目
    public wServerType: number;           //房间类型
    public wTableCount: number;           //桌子数目
    public cbTimeOutCard = 20;		        //出牌时间
    public cbTimeCallScore = 20;			//叫分时间
    public cbTimeOutExitGame = 13;		        //后端不准备踢人时间
    public lCellScore = 0;                      //房间底分
    public bIsDouble = 0;                       //房间基础倍数

    public userInfo = {}; //广场里所有玩家信息所有玩家信息
    //玩家信息
    public wTableId_my_up;//记录之前的桌子，如果下次桌子变成65535说明被踢出房间
    public wTableId_my;
    public wChairId_my;
    public wTableId_right;
    public wChairId_right;
    public wTableId_left;
    public wChairId_left;

    public id_left: number;
    public id_right: number;

    public faceId_right: number;
    public faceId_left: number;
    //金币
    public lUserScore: number;
    public gold_right: number;
    public gold_left: number;

    public status_my: number;
    public status_left: number;
    public status_right: number;

    //以上数据在新开局时不需要重置
    public gameNumbering: string = "";           //牌局编号
    public cbGameStatus: any;                //游戏状态
    public cbCardData: Array<number>;        //扑克列表
    public szUserArea;                      //用户地区

    public wCurrentUser;                 //当前等待操作的玩家
    public wBankerUser;                     //地主座位
    public cbBankerScore;;                    //地主叫的分数
    public cbBankerCard: Array<number>;        //地主牌
    public wCallScoreUser;                      //上次叫分的人
    public cbUserCallScore;                    //上次叫的分
    public wCallDoubleUser;                     //上次加倍的人
    public cbIsDouble;                      //上次是否加倍 1是 0 否
    public cbIsDoubleNumber = 0;             //当前房间倍数

    public wOutCardUser;                        //上次出牌的人
    public upPlayList: Array<any> = [];          //上次出的牌
    public upPlayType;                          //上次的牌型
    public wPassCardUser;                           //上次弃牌的人
    public cbTurnOver;                              //一轮结束

    public game_state: number;
    //是否叫分 (叫分阶段刷新的记录每个人的叫分情况，决定是否还亮叫分按钮)
    public jiaofen_my = 0;
    public jiaofen_left = 0;
    public jiaofen_right = 0;
    //手牌
    public chessListBanker: Array<Poker_DDZ> = [];//地主牌后，端传回ID在前端转化为对象
    public chessListMy: Array<Poker_DDZ> = [];  //自己手牌，后端传回ID在前端转化为对象
    public chessListUp: Array<Poker_DDZ> = []; //上次出的牌，后端传回ID在前端转化为对象，以便排序和做牌型匹配与提示
    public chessListRightLength: number = 17;
    public chessListLeftLength: number = 17;
    //游戏结束时左右两家剩余的牌
    public chessListRightOver: Array<any> = [];
    public chessListLeftOver: Array<any> = [];
    //记牌器
    public chessListWhole = { 1: 4, 2: 4, 3: 4, 4: 4, 5: 4, 6: 4, 7: 4, 8: 4, 9: 4, 10: 4, 11: 4, 12: 4, 13: 4, 14: 1, 15: 1 }
    //单局得分
    public score_my;
    public score_right;
    public score_left;
    //记牌器是否购买
    public owningRecorder: boolean = false;

    //提示功能我可以出的牌组
    public canPlayType: number = 0; //0 按下面canPlayGroup出 1随便出 
    public canPlayGroup: Array<Array<Poker_DDZ>> = [];
    //地主还是农民赢了0地主1农民
    public winUser = 0;
    public bChunTian = 0;
    public bFanChunTian = 0;
    //是否在托管
    public tuoguan = false;

    //数据恢复时使用的数据
    public cbDoubleInfo = null;//各自加倍情况
    public cbHandCardCount = null;//各自手牌数量

    //重置玩家信息
    public initUserInof() {
        //玩家信息
        this.wTableId_my = null;
        this.wChairId_my = null;

        this.lUserScore = null;

        this.id_right = null;
        this.wTableId_right = null;
        this.wChairId_right = null;
        this.faceId_right = null;
        this.gold_right = null;

        this.id_left = null;
        this.wTableId_left = null;
        this.wChairId_left = null;
        this.faceId_left = null;
        this.gold_left = null;

        this.status_my = null          //0 没有 1 站立  2  坐下  3 同意 4 旁观 5  游戏  6  断线
        this.status_right = null
        this.status_left = null
    }
    //重置VO对象
    public initData() {
        this.cbGameStatus = null;              //游戏状态
        this.cbCardData = [];        //扑克列表
        this.szUserArea = null;;                      //用户地区
        this.wCurrentUser = null;                 //当前等待操作的玩家
        this.wBankerUser = null;                     //地主座位
        this.cbBankerScore = null;                    //地主叫的分数
        this.cbBankerCard = [];        //地主牌
        this.wCallScoreUser = null;                      //上次叫分的人
        this.cbUserCallScore = null;                    //上次叫的分
        this.wCallDoubleUser = null;;                     //上次加倍的人
        this.cbIsDouble = null;;                      //上次是否加倍 1是 0 否
        this.cbIsDoubleNumber = 0;                    //当前倍数（= bIsDouble + cbIsDouble + cbIsDouble + cbIsDouble）

        this.wOutCardUser = null;;                        //上次出牌的人
        this.upPlayList = [];          //上次出的牌
        this.upPlayType = null;;                          //上次的牌型
        this.wPassCardUser = null;;                           //上次弃牌的人
        this.cbTurnOver = null;;                              //一轮结束
        //叫分状态
        this.jiaofen_my = 0;
        this.jiaofen_left = 0;
        this.jiaofen_right = 0;

        //手牌
        this.chessListBanker = [];//地主牌后，端传回ID在前端转化为对象
        this.chessListMy = [];  //自己手牌，后端传回ID在前端转化为对象
        this.chessListUp = []; //上次出的牌，后端传回ID在前端转化为对象，以便排序和做牌型匹配与提示
        this.chessListRightLength = 17;
        this.chessListLeftLength = 17;
        //游戏结束时左右两家剩余的牌
        this.chessListRightOver = [];
        this.chessListLeftOver = [];
        //记牌器
        this.chessListWhole = { 1: 4, 2: 4, 3: 4, 4: 4, 5: 4, 6: 4, 7: 4, 8: 4, 9: 4, 10: 4, 11: 4, 12: 4, 13: 4, 14: 1, 15: 1 }
        //单局得分
        this.score_my = null;;
        this.score_right = null;;
        this.score_left = null;;
        //记牌器是否购买
        this.owningRecorder = false;

        //提示功能我可以出的牌组
        this.canPlayType = 0; //0 按下面canPlayGroup出 1随便出 
        this.canPlayGroup = [];
        this.winUser = 0;
        this.bChunTian = 0;
        this.bFanChunTian = 0;
        this.tuoguan = false;
    }
}
